﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// UpPackHistory数据模型对象
    /// </summary>
    [Serializable]
    public partial class UpPackHistoryMod
    {
        /// <summary>
        /// 初始化UpPackHistory数据模型对象
        /// </summary>
        public UpPackHistoryMod()
        {
            
        }
        /// <summary>
        /// 初始化UpPackHistory数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="rowKey">RowKey</param>
        public UpPackHistoryMod(string rowKey)
        {
            //给RowKey字段赋值
            this.RowKey = rowKey;
        }
        /// <summary>
        /// 初始化UpPackHistory数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="rowKey">RowKey</param>
        /// <param name="deviceNO">DeviceNO</param>
        /// <param name="upKey">UpKey</param>
        /// <param name="packIndex">PackIndex</param>
        /// <param name="changeTime">ChangeTime</param>
        /// <param name="packCount">packCount</param>
        public UpPackHistoryMod(string rowKey,string deviceNO,string upKey,int? packIndex,DateTime? changeTime,int? packCount)
        {
            //给RowKey字段赋值
            this.RowKey = rowKey;
            //给DeviceNO字段赋值
            this.DeviceNO = deviceNO;
            //给UpKey字段赋值
            this.UpKey = upKey;
            //给PackIndex字段赋值
            this.PackIndex = packIndex;
            //给ChangeTime字段赋值
            this.ChangeTime = changeTime;
            //给packCount字段赋值
            this.PackCount = packCount;
        }
        
		//属性存储数据的变量
        private string _rowKey;
        private string _deviceNO;
        private string _upKey;
        private int? _packIndex;
        private DateTime? _changeTime;
        private int? _packCount;
        
        /// <summary>
        /// RowKey
        /// </summary>
        public string RowKey
        {
            get { return this._rowKey; }
            set { this._rowKey = value; }
        }
        /// <summary>
        /// DeviceNO
        /// </summary>
        public string DeviceNO
        {
            get { return this._deviceNO; }
            set { this._deviceNO = value; }
        }
        /// <summary>
        /// UpKey
        /// </summary>
        public string UpKey
        {
            get { return this._upKey; }
            set { this._upKey = value; }
        }
        /// <summary>
        /// PackIndex
        /// </summary>
        public int? PackIndex
        {
            get { return this._packIndex; }
            set { this._packIndex = value; }
        }
        /// <summary>
        /// ChangeTime
        /// </summary>
        public DateTime? ChangeTime
        {
            get { return this._changeTime; }
            set { this._changeTime = value; }
        }
        /// <summary>
        /// packCount
        /// </summary>
        public int? PackCount
        {
            get { return this._packCount; }
            set { this._packCount = value; }
        }
        
        /// <summary>
        /// 对比两个UpPackHistory数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的UpPackHistory数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成UpPackHistory数据模型对象
            UpPackHistoryMod upPackHistoryMod = obj as UpPackHistoryMod;
            //判断是否转换成功
            if (upPackHistoryMod == null) return false;
            //进行匹配属性的值
            return
                //判断RowKey是否一致
                this.RowKey == upPackHistoryMod.RowKey &&
                //判断DeviceNO是否一致
                this.DeviceNO == upPackHistoryMod.DeviceNO &&
                //判断UpKey是否一致
                this.UpKey == upPackHistoryMod.UpKey &&
                //判断PackIndex是否一致
                this.PackIndex == upPackHistoryMod.PackIndex &&
                //判断ChangeTime是否一致
                this.ChangeTime == upPackHistoryMod.ChangeTime &&
                //判断packCount是否一致
                this.PackCount == upPackHistoryMod.PackCount;
        }
        /// <summary>
        /// 将当前UpPackHistory数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将UpPackHistory数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将RowKey进行按位异或运算处理
                (this.RowKey == null ? 2147483647 : this.RowKey.GetHashCode()) ^
                //将DeviceNO进行按位异或运算处理
                (this.DeviceNO == null ? 2147483647 : this.DeviceNO.GetHashCode()) ^
                //将UpKey进行按位异或运算处理
                (this.UpKey == null ? 2147483647 : this.UpKey.GetHashCode()) ^
                //将PackIndex进行按位异或运算处理
                (this.PackIndex == null ? 2147483647 : this.PackIndex.GetHashCode()) ^
                //将ChangeTime进行按位异或运算处理
                (this.ChangeTime == null ? 2147483647 : this.ChangeTime.GetHashCode()) ^
                //将packCount进行按位异或运算处理
                (this.PackCount == null ? 2147483647 : this.PackCount.GetHashCode());
        }
        /// <summary>
        /// 将当前UpPackHistory数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前UpPackHistory数据模型对象转换成字符串副本
            return
                "[" +
                //将RowKey转换成字符串
                this.RowKey +
                "]";
        }
    }
}
